home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Dema / betonsoldier_spdemo.exe / {app} / Shaders / mesh_trail.fx < prev    next >
Encoding:
Text File  |  2005-05-05  |  4.4 KB  |  200 lines

  1. //------------------------------------------------------------------------------------------------------
  2. // mesh_debug_Artefacts.fx
  3. //
  4. // file type: Shader File
  5. // Usage        : line rendering
  6. // 
  7. //------------------------------------------------------------------------------------------------------
  8.  
  9. #include "shared.fx"
  10. #include "lighting.fx"
  11. #define FOG_DISABLE
  12. #include "fog.fx"
  13.  
  14. texture DiffuseMap;
  15.  
  16. //------------------------------------
  17. struct vertexInput 
  18. {
  19.     float4 Position        : POSITION;
  20.     float4 Color        : COLOR0;
  21.     float2 DiffuseUV    : TEXCOORD0;    
  22. };
  23.  
  24. struct vertexOutput 
  25. {
  26.     float4 Position : POSITION;
  27.     float4 Color     : COLOR0;
  28.     float2 DiffuseUV: TEXCOORD0;
  29.     FOG_OPTION_VERTEX_FIELD
  30. };
  31.  
  32. //------------------------------------
  33. vertexOutput VS_Trail_Tranform(vertexInput input) 
  34. {
  35.     vertexOutput output;
  36.     output.Position      = mul (input.Position,CameraProjection);
  37.     output.Color      = input.Color;    
  38.     output.DiffuseUV  = input.DiffuseUV;
  39.     
  40.     
  41.     // fog computation
  42.     FOG_OPTION_COMPUTE(output, output.Position);
  43.     
  44.     return output;
  45. }
  46.  
  47. //-----------------------------------
  48. technique Trail_PunchThrough
  49. <
  50.     int Priority = 10;
  51.     int NeedSorting = 0;
  52.     int TechniqueIndex = 0;
  53.     int DeviceType = HWSHADER_ONLY;
  54.     int LightingType = INTEGRATED_LIGHTING;
  55.     string RenderingType = "Standard";
  56. >
  57. {
  58.     pass pass1
  59.     {
  60.         Texture[0]            = <DiffuseMap>;
  61.         MinFilter[0]        = LINEAR;
  62.         MagFilter[0]        = LINEAR;
  63.         MipFilter[0]        = LINEAR;
  64.         AddressU[0]            = CLAMP;
  65.         AddressV[0]            = CLAMP;
  66.         CullMode            = CCW;
  67.         ZEnable                = true;
  68.         ZFunc                = LESSEQUAL;
  69.         ZWriteEnable        = true;
  70.         AlphaBlendEnable    = false;
  71.         AlphaTestEnable        = true;
  72.         AlphaRef            = 192;
  73.         AlphaFunc            = GREATEREQUAL;
  74.         FOG_OPTION_PARAMETERS;
  75.             
  76.         
  77.         VertexShader = compile vs_1_1 VS_Trail_Tranform();
  78.  
  79.         // sample tex mult vert color
  80.         PixelShader     = 
  81.         asm
  82.         {
  83.             ps_1_1
  84.             
  85.             tex t0
  86.         
  87.             mul r0, v0, t0
  88.         };
  89.     }
  90. }
  91.  
  92.  
  93. //-----------------------------------
  94. technique Trail_Additive
  95. <
  96.     int Priority = 10;
  97.     int NeedSorting = 1;
  98.     int TechniqueIndex = 1;
  99.     int DeviceType = HWSHADER_ONLY;
  100.     int LightingType = INTEGRATED_LIGHTING;
  101.     string RenderingType = "Standard";
  102. >
  103. {
  104.     pass pass1
  105.     {
  106.         Texture[0]            = <DiffuseMap>;
  107.         MinFilter[0]        = LINEAR;
  108.         MagFilter[0]        = LINEAR;
  109.         MipFilter[0]        = LINEAR;
  110.         AddressU[0]            = CLAMP;
  111.         AddressV[0]            = CLAMP;
  112.     
  113.         CullMode            = CCW; 
  114.         ZEnable                = true; 
  115.         ZFunc                = LESSEQUAL;
  116.         ZWriteEnable        = false; 
  117.         AlphaTestEnable        = false;        
  118.         AlphaBlendEnable    = true;
  119.         SrcBlend            = ONE;
  120.         DestBlend            = ONE;
  121.         FogEnable            = false;
  122.         
  123.         FOG_OPTION_PARAMETERS;
  124.         
  125.         
  126.         VertexShader = compile vs_1_1 VS_Trail_Tranform();
  127.  
  128.         // sample tex mult vert color
  129.         PixelShader     = 
  130.         asm
  131.         {
  132.             ps_1_1
  133.             
  134.             tex t0
  135.         
  136.             mul r0, v0, t0
  137.             mul r0, r0, t0.a
  138.         };
  139.     }
  140. }
  141.  
  142.  
  143. //-----------------------------------
  144. technique Trail_AlphaBlend
  145. <
  146.     int Priority = 10;
  147.     int NeedSorting = 1;
  148.     int TechniqueIndex = 2;
  149.     int DeviceType = HWSHADER_ONLY;
  150.     int LightingType = INTEGRATED_LIGHTING;
  151.     string RenderingType = "Standard";
  152. >
  153. {
  154.     pass pass1
  155.     {
  156.         Texture[0]            = <DiffuseMap>;
  157.         MinFilter[0]        = LINEAR;
  158.         MagFilter[0]        = LINEAR;
  159.         MipFilter[0]        = LINEAR;
  160.         AddressU[0]            = CLAMP;
  161.         AddressV[0]            = CLAMP;
  162.     
  163.         CullMode            = CCW; 
  164.         ZEnable                = true; 
  165.         ZFunc                = LESSEQUAL;
  166.         ZWriteEnable        = false; 
  167.         AlphaTestEnable        = false;        
  168.         AlphaBlendEnable    = true;
  169.         SrcBlend            = SRCALPHA;
  170.         DestBlend            = INVSRCALPHA;
  171.         FogEnable            = false;
  172.         
  173.         FOG_OPTION_PARAMETERS;
  174.         
  175.         
  176.         VertexShader = compile vs_1_1 VS_Trail_Tranform();
  177.  
  178.         // sample tex mult vert color
  179.         PixelShader     = 
  180.         asm
  181.         {
  182.             ps_1_1
  183.             
  184.             tex t0
  185.         
  186.             mul r0, v0, t0
  187.         };
  188.     }
  189. }
  190.  
  191. //------------------------------------------------------------------------------------------------------
  192. //------------------------------------------------------------------------------------------------------
  193. //------------------------------------------------------------------------------------------------------
  194.  
  195. #include "mesh_shadow.fx"
  196. #include "mesh_shadow_projector.fx"
  197.  
  198. //------------------------------------------------------------------------------------------------------
  199. //------------------------------------------------------------------------------------------------------
  200. //------------------------------------------------------------------------------------------------------